number pattern in python using for loop